
'''
26. 删除有序数组中的重复项
'''
from typing import List


class Solution:
    '''
    快慢指针
    '''
    def removeDuplicates(self, nums: List[int]) -> int:
        if not nums:
            return 0
        fast = 0;
        slow = 0;

        while fast < len(nums):
            if nums[fast] != nums[slow]:
                slow += 1
                nums[slow] = nums[fast]
            fast += 1
        return slow + 1